package com.osmino.contacts.entity;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import android.accounts.Account;

public final class LocalAccount {

	public String type, name;
	public static final String SIM_ACCOUNT_TYPE = "com.anddroid.contacts.sim";
	public static final String GOOGLE_ACCOUNT_TYPE = "com.google";
	public static final String FACEBOOK_ACCOUNT_TYPE = "com.facebook.auth.login";
	public static final String TWITTER_ACCOUNT_TYPE = "com.twitter.android.auth.login";
	public static final List<String> types;
	
	static {
		List<String> rawTypesList = new ArrayList<String>();
		rawTypesList.add(GOOGLE_ACCOUNT_TYPE);
		rawTypesList.add(FACEBOOK_ACCOUNT_TYPE);
		rawTypesList.add(TWITTER_ACCOUNT_TYPE);
		types = Collections.unmodifiableList(rawTypesList);
	}

	public LocalAccount(String type, String name) {
		this.type = type;
		this.name = name;
	}
	
	public LocalAccount(Account account) {
		this.type = account.type;
		this.name = account.name;
	}
	
	public boolean isPhoneAccount() {
		return type == null;
	}
	
	public static LocalAccount createPhoneAccount() {
		return new LocalAccount(null, null);
	}
}
